package com.kuanter.kuanterauto.message;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.kuanter.kuanterauto.R;
import com.kuanter.kuanterauto.baseui.BaseActivity_NoBar;
import com.umeng.analytics.MobclickAgent;

public class MessageDetailActivity extends BaseActivity_NoBar{
	
	Button btTopLeft_msgdtl=null;
	Button bt_duanxin=null;
	TextView tv_msgcontent = null;
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.message_detail);
		
		Bundle bundle = this.getIntent().getExtras();
        
        /*获取Bundle中的数据，注意类型和key*/
        String title = bundle.getString("title");
        String content = bundle.getString("content");
        
        TextView titleView = (TextView) findViewById(R.id.tv_msgtitle);
        titleView.setText(title);
        
        tv_msgcontent = (TextView) findViewById(R.id.tv_msgcontent);
        tv_msgcontent.setText("        "+content);
        
        btTopLeft_msgdtl=(Button) findViewById(R.id.btTopLeft_msgdtl);
        btTopLeft_msgdtl.setOnClickListener(this);
        
        bt_duanxin=(Button) findViewById(R.id.bt_duanxin);
        bt_duanxin.setOnClickListener(this);
        
		}
	
    
	
	@Override
	public void onClick(View v) {
		switch(v.getId()){
		case R.id.btTopLeft_msgdtl:
			finish();
			break;
		case R.id.bt_duanxin:
			String smsContent = this.getIntent().getExtras().getString("content");
			Intent it = new Intent(Intent.ACTION_VIEW);
			it.putExtra("sms_body", smsContent);
			it.setType("vnd.android-dir/mms-sms");
			startActivity(it);
			
		    
			break;
		}
	}
	
	@Override
	protected void onResume() {
		MobclickAgent.onResume(this);
		super.onResume();
	}
	
	@Override
	protected void onPause() {
		MobclickAgent.onPause(this);
		super.onPause();
	}

}
